import fetch from "./fetch";

export const POST = ( url = '', data = {}) => {
    return fetch({
        url,
        data,
        method: 'POST'
    }).then(res => {
        return res;
    });
};
export const PUT = ( url = '', data = {}) => {
    return fetch({
        url: url,
        data,
        method: 'PUT'
    }).then(res => {
        return res;
    });
};

export const GET = (url = '', params = {}) => {
    return fetch({
        url: url,
        method: 'GET',
        params
    }).then(res => {
        return res;
    });
};
export const DEL = (url = '', data = {}) => {
    return fetch({
        url: url,
        data,
        method: 'DELETE'
    }).then(res => {
        return res;
    });
};
const Apis = {
    POST,
    GET,
    PUT,
    DEL
}
export default Apis;
